home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
sm32a.zip
/
KEYWORD
/
IF.KEY
< prev
next >
Wrap
Text File
|
1993-11-07
|
608b
|
16 lines
* if internal
if(condition then x)
It gives x if condition evaluates to 1, or left unevaluated otherwise.
if(condition then x else y)
It gives x if condition evaluates to 1, y if it evaluates to 0, or
left unevaluated if the condition is neither 1 nor 0.
Note that the words then and else can be replaced by comma ,.
It is useful in definition of the use-defined function to left the
function unevaluted if the argument of the function is not number.
See also: isnumber.
e.g.
IN: f(x_):=if(isnumber(x), 1)
IN: f(x), f(10)
OUT: f(x), 1